Skip to content

fix(bindings): write attribute values in their canonical string form - #336

Open
EmiRZx wants to merge 2 commits into
cloudevents:mainfrom
EmiRZx:canonical-attribute-strings
Open

EmiRZx wants to merge 2 commits into
cloudevents:mainfrom
EmiRZx:canonical-attribute-strings

Conversation

@EmiRZx

@EmiRZx EmiRZx commented Dec 1, 2026

Copy link
Copy Markdown

Related Issue: #335

Type of change:

  • Bug fix (non-breaking change which fixes an issue)

Description:

common.attribute_to_string returns the type system's string form: Boolean as true/false, Binary as Base64, Timestamp as RFC 3339 with Z. HTTP, Kafka and RabbitMQ binary mode use it instead of str() and their own datetime branches.

the RabbitMQ test test_to_binary_boolean_extension_converted_to_string asserted "True"; it now expects "true".


Pre-submission checklist:

  • I have read the CONTRIBUTING.md file.
  • I have signed off my commits using git commit --signoff.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have updated the documentation (README.md, CHANGELOG.md, etc.) as necessary.
  • I have run pre-commit and tox and all checks pass. (no tox config in the repo; ran uv run pytest tests: 581 passed.)
  • This pull request is ready to be reviewed.

The HTTP, Kafka and RabbitMQ bindings converted attribute values with
str(), so Boolean values were written as True/False and Binary values
as Python reprs. Write them as true/false and Base64, as the
CloudEvents type system defines, through one shared helper.

Signed-off-by: emir <52245396+EmiRZx@users.noreply.github.com>
Signed-off-by: emir <52245396+EmiRZx@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant